import Cookies from 'js-cookie'

/**
 * 设置cookies
 * @param {*} key cookies名称
 * @param {*} value cookies值
 * @param {*} expires 过期时间，单位秒,默认43200秒，即12小时
 */
export const setCookie = (key,value,expires=43200)=>{
   // let time = new Date(new Date() * 1 + expires * 1000);
	//Cookies.set(key, value, { expires: time });
    localStorage.setItem(key,value)
}

/**
 * 获取cookies
 * @param {*} key cookies名称
 */
export const getCookie = (key) =>{
   // return Cookies.get(key)
   return localStorage.getItem(key)
}

/**
 * 删除cookies
 * @param {*} key cookies名称
 */
export const removeCookie = (key)=>{
    Cookies.remove(key)
    localStorage.removeItem(key)
}